/**
 * Copyright (C) 2017 - 2020 https://github.com/joewee
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * <p>
 * http://www.apache.org/licenses/LICENSE-2.0
 * <p>
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.bifrost.entity;

import javax.persistence.*;
import java.math.BigDecimal;

/**
 * Date: 2017/9/27
 * Time: 16:46
 *
 * @author bifrost
 * @version 1.0.0
 */
@Entity
@Table(name = "SKU_SHIPMENT_FREE_REGION")
@NamedQuery(name = "SkuShipmentFreeRegion.findAll", query = "SELECT s FROM SkuShipmentFreeRegion s")
public class SkuShipmentFreeRegion {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "SKU_SHIPMEN_FREE_REGION_ID", unique = true, nullable = false)
    private Long skuShipmentFreeRegionId;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHIPMENT_CITY", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private CountryArea shipmentCity;


    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHIPMENT_COUNTRY", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private Country shipmentCountry;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHIPMENT_DISTRICT", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private CountryArea shipmentDistrict;

    //bi-directional many-to-one association to CountryArea
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SHIPMENT_STATE", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private CountryArea shipmentState;

    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SKU_SHIPMENT_ID", foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT))
    private SkuShipment skuShipment;

    @Column(name = "CALCULATE_TYPE", length = 100)
    private String calculateType;

    @Column(name = "REQUIRED")
    private BigDecimal required;

    @Column(name = "MAX")
    private BigDecimal max;

    public Long getSkuShipmentFreeRegionId() {
        return skuShipmentFreeRegionId;
    }

    public void setSkuShipmentFreeRegionId(Long skuShipmentFreeRegionId) {
        this.skuShipmentFreeRegionId = skuShipmentFreeRegionId;
    }

    public CountryArea getShipmentCity() {
        return shipmentCity;
    }

    public void setShipmentCity(CountryArea shipmentCity) {
        this.shipmentCity = shipmentCity;
    }

    public Country getShipmentCountry() {
        return shipmentCountry;
    }

    public void setShipmentCountry(Country shipmentCountry) {
        this.shipmentCountry = shipmentCountry;
    }

    public CountryArea getShipmentDistrict() {
        return shipmentDistrict;
    }

    public void setShipmentDistrict(CountryArea shipmentDistrict) {
        this.shipmentDistrict = shipmentDistrict;
    }

    public CountryArea getShipmentState() {
        return shipmentState;
    }

    public void setShipmentState(CountryArea shipmentState) {
        this.shipmentState = shipmentState;
    }

    public SkuShipment getSkuShipment() {
        return skuShipment;
    }

    public void setSkuShipment(SkuShipment skuShipment) {
        this.skuShipment = skuShipment;
    }

    public String getCalculateType() {
        return calculateType;
    }

    public void setCalculateType(String calculateType) {
        this.calculateType = calculateType;
    }

    public BigDecimal getRequired() {
        return required;
    }

    public void setRequired(BigDecimal required) {
        this.required = required;
    }

    public BigDecimal getMax() {
        return max;
    }

    public void setMax(BigDecimal max) {
        this.max = max;
    }

}
